package org.easyelf.springmvc.core.aspect;

/**
 * @Title: HandleDataSource
 * @Description:
 * @Package: org.easyelf.springmvc.core.aspect with IntelliJ IDEA
 * @User: RehngaO
 * @Date: 2017-02-18
 * @Time: 下午5:11
 */
public class HandleDataSource {

    // 数据源名称线程池
    private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();

    public static void putDataSource(String datasource) {
        contextHolder.set(datasource);
    }

    public static String getDataSource() {
        return contextHolder.get();
    }

    public static void clear() {
        contextHolder.remove();
    }
}
